<template>
  <div class="pdfView">
    <!-- <mumu-previewOffce :fileUrl='url' v-model='showPreview' @change="change"></mumu-previewOffce> -->
    <!-- <view class="closes" @tap="onBack">
      <view class="icon"></view>
    </view>
    <web-view :src="showUrl"></web-view> -->
    <ss-preview :fileUrl="url" :fileType="fileType" :imageList="imageList"></ss-preview>
  </div>
</template>

<script>
import MumuPreviewOffce from "@/uni_modules/mumu-previewOffce/components/mumu-previewOffce/mumu-previewOffce.vue";
export default {
  name: "pdfView",
  components: {
    MumuPreviewOffce,
  },
  props: {
    url: {
      type: String,
      default: () => "",
    },
  },
  watch: {
    url: {
      handler: function (newVal) {
        this.showUrl = "../../../static/pdf/pdf.html?url=" + newVal;
      },
      immediate: true,
    },
  },
  data() {
    return {
      showPreview: true,
      showUrl: "",
      // -----------------
      fileUrl: "", //预览单个文档或视频传递url
      fileType: "2", //类型（1.预览图片，2.预览文件，3.预览视频
      imageList: [], //预览单个或多个图片传递数组
    };
  },
  async onLoad() {},
  created() {},
  methods: {
    change() {
      uni.navigateBack();
    },
  },
  mounted() {},
};
</script>

<style lang="scss" scoped>
.pdfView {
  width: 100%;
  height: 100%;

  // position: fixed;
  // top: 0;
  // left: 0;
  // width: 100%;
  // height: 80rpx;
  // background: #fff;
  // z-index: 1000;
  // display: flex;
  // align-items: center;
  .closes {
    width: 100rpx;
    height: 100%;
    padding-left: 20rpx;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    .icon {
      width: 50rpx;
      height: 50rpx;
      background: #000;
    }
  }
}
</style>
